package server

import (
	"animal/octopus/api"

	"github.com/gin-gonic/gin"
)

func (server *Server) BuildRouters(app *gin.Engine) {
	app.POST("/api/login", api.Login)
	app.GET("/api/getUserInfo", api.GetUserInfo)

	app.GET("/api/module/children", api.GetChildren)
	app.GET("/api/module/descendants", api.GetDescendants)
	app.POST("/api/module/create", api.CreateModule)
	app.POST("/api/module/edit", api.EditModule)
	app.POST("/api/module/batch_edit", api.BatchEditModule)
	app.POST("/api/module/delete", api.DeleteModule)
	app.POST("/api/module/report", api.Report)
	app.POST("/api/module/import", api.ImportModule)

	app.GET("/api/topo_view/list", api.GetTopoViewList)
	app.POST("/api/topo_view/create", api.CreateTopoView)
	app.POST("/api/topo_view/edit", api.EditTopoView)
	app.POST("/api/topo_view/delete", api.DeleteTopoView)

	app.GET("/api/topo_module/list", api.GetTopoModuleList)
	app.POST("/api/topo_module/update", api.UpdateTopoModule)

	app.GET("/api/topo_rule/list", api.GetTopoRuleList)
	app.POST("/api/topo_rule/create", api.CreateTopoRule)
	app.POST("/api/topo_rule/delete", api.DeleteTopoRule)

	app.GET("/api/report_rule/list", api.GetReportRuleList)
	app.POST("/api/report_rule/create", api.CreateReportRule)
	app.POST("/api/report_rule/edit", api.EditReportRule)
	app.POST("/api/report_rule/delete", api.DeleteReportRule)
	app.POST("/api/report_rule/import", api.ImportReportRule)

	app.POST("/api/event/list", api.GetEventList)
	app.POST("/api/event/delete", api.DeleteEvent)
	app.POST("/api/event/batch_delete", api.BatchDeleteEvent)

	app.GET("/api/dependency/list", api.GetDependencyList)
}
